/*
 * (c) Elena Simona Apostol
 */

#ifndef SOCKET_UTILITIES_H_
#define SOCKET_UTILITIES_H_

#include <string>

int create_socket ();

int listen_on_socket (int port, int backlog);

int accept_connection_on_socket (int sock);

int connect_to_server (int sock, const std::string &remote_ip, int remote_port);

int send_data_on_socket (int sock, const void* data, int length);

int send_data_len_prefixed (int sock, const std::string& message);

int receive_data_on_socket (int sock, void* data, int length);

#endif /*SOCKET_UTILITIES_H_*/

